In most computing systems, low level instruction code is used as an intermediary between the hardware components of the computing system and the operating software and other high level software executing on the computing system. In some computer systems, this low level instruction code is known as the Basic Input and Output System (“BIOS”). The BIOS provides a set of software routines that allow high level software to interact with the hardware components of the computing system using standard calls.
Because of limitations of the BIOS in many PC-compatible computers, a new specification for creating the firmware that is responsible for booting the computer and for intermediating the communication between the operating system and the hardware has been created. The new specification is called the Extensible Firmware Interface (“EFI”) Specification and is available from INTEL CORPORATION. The original EFI Specification from INTEL CORPORATION is also being extended by the Unified Extensible Firmware Interface Forum (“UEFI”).
The EFI Specification describes an interface between the operating system and the system firmware. In particular, the EFI Specification defines the interface that platform firmware must implement and the interface that the operating system may use in booting. How the firmware implements the interface is left up to the manufacturer of the firmware. The EFI Specification also specifies that protocols should be provided for EFI drivers to communicate with each other. An EFI protocol is an interface definition provided by an EFI driver. The EFI core provides protocols for allocation of memory, creating events, setting the clock, and many others.
In order to provide functionality for providing user input and output in an EFI-based firmware, the EFI Specification provides for a Human Interface Infrastructure (“HII”) database. The HII database is maintained within EFI and is used to store strings and fonts utilized by drivers executing within the EFI environment. Forms and other user interface properties may also be stored in the HII database. An HII database driver creates and maintains the HII database.
In order to provide access to the HII database to other drivers executing within EFI, the HII database driver exposes an HII database protocol interface. Other drivers executing within EFI can utilize the HII database protocol interface to store and retrieve data in the HII database. For instance, the HII database driver provides functionality for registering packages (also referred to herein as “packs”) containing forms, strings, and fonts, and for storing the contents of these packs in the HII database. The HII database driver also provides functions for retrieving information about the data contained in the HII database and the data itself. The HII database protocol interface exposed by the HII database driver is specifically defined in the INTEL Platform Innovation Framework for EFI HII Specification (the “Framework”), which is expressly incorporated herein by reference.
The implementation of the HII database driver suggested by the Framework suffers from at least one drawback. In particular, when an EFI driver (also referred to herein as a “requestor”) requests a string contained in the HII database from the HII database driver, the requestor provides a pointer to a memory buffer for the HII database driver to copy the string into. The requestor also informs the HII database driver of the size of the buffer. The HII database driver must then validate the buffer by calculating the length of the requested string and determining whether the provided buffer is large enough to hold the string. If the provided buffer is large enough, the HII database driver copies the requested string into the buffer. If, however, the provided buffer is not large enough, the HII database driver returns an error and an indication of the buffer size needed to contain the requested string. The requestor must then deallocate the previous buffer, create a sufficiently large memory buffer to hold the string, and generate another request to the HII database driver for the string. Calculating the size of a string each time a request for the string is made and requiring the requestor to create a second buffer in the event that the first buffer is not large enough is a very inefficient process for obtaining a string from the HII database.
It is with respect to these considerations and others that the various embodiments of the invention have been made.